import {customeStruct} from '../utils';
const itf = customeStruct.interface;

export const InitDataStruct = itf({
    payload: itf({
        brands: [itf(Object.assign({
            id: 'string',
            code: 'string',
            name: 'string',
        }))],
    })
});

const content = {
    id: 'string',
    orderCode: 'string',
    partOrderTypeName: 'string? | null',
    piCode: 'string? | null',
    paymentType: 'number? | null',
    transportType: 'number? | null',
    palletizing: 'number? | null',
    status: 'number',
    submitTime: 'datetime? | null',
    dealerCode: 'string',
    dealerName: 'string? | null',
    labelRequirement: 'string? | null',
    shippingMark: 'string? | null',
    isSeparate: 'boolean? | null'
};

export const List = itf({
    payload: itf({
        content: [itf(Object.assign(content))]
    })
});

export const Detail = itf({
    payload: itf({
        id: 'string',
        orderCode: 'string',
        partOrderTypeName: 'string? | null',
        piCode: 'string? | null',
        paymentType: 'number? | null',
        transportType: 'number? | null',
        palletizing: 'number? | null',
        cabinetType: 'number? | null',
        status: 'number',
        submitTime: 'datetime? | null',
        dealerCode: 'string',
        dealerName: 'string? | null',
        labelRequirement: 'string? | null',
        shippingMark: 'string? | null',
        isDangerousGoods: 'string? | null',
        isAirMagneticCheck: 'string? | null',
        isChemicalCheck: 'string? | null',
        isSeparate: 'boolean? | null',
        isEngine: 'boolean? | null',
        details: [
            itf({
                partId: 'string',
                partCode: 'string',
                partName: 'string',
                planQuantity: 'number? | null',
                businessCheck: 'boolean? | null',
                dangerousGoods: 'boolean? | null',
                airMagneticCheck: 'boolean? | null',
                chemicalCheck: 'boolean? | null'
            })
        ]
    })
});
export const PartSaleOrderList = itf({
    payload: itf({
        content: [itf(Object.assign({
            id: 'string',
            code: 'string',
            details: [
                itf({
                    partId: 'string',
                    partCode: 'string',
                    partName: 'string',
                    planQuantity: 'number? | null',
                    businessCheck: 'boolean? | null',
                    dangerousGoods: 'boolean? | null',
                    airMagneticCheck: 'boolean? | null',
                    chemicalCheck: 'boolean? | null'
                })
            ]
        }))],
    })
});
const dealer = {
    id: 'string',
    code: 'string',
    name: 'string'
};

export const DealerList = itf({
    payload: itf({
        content: [itf(dealer)]
    })
});

export const DealerSimpleList = itf({
    payload: itf({
        content: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string'
            })
        ]
    })
});
